<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\admin\model\Devicecate as DevicecateModel;

/**
 * @产品分类
 */
class Devicecate extends Api
{    
    // 无需登录的接口,*表示全部
    protected $noNeedLogin = ['list', 'info', 'listRecommend'];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['test2'];

    /**
     * @分类列表
     */
    public function list(DevicecateModel $D)
    {
        $categories = $D->where('switch',1)->order('weigh DESC')->select();
        
        $this->success('产品分类列表', $categories);
    }
    
}
